var currentLink=-1;var currentRow=null;var GLOBAL_bDisableActions=false;var GLOBAL_bDisableDD=false;function BXOpenFD(e,t){window.GLOBAL_FD_PLAYLIST_IND=e;if(t=="VIDEO")OpenFD_playlist_video();else OpenFD_playlist_image()}function BXSaveVideoPath(e,t){var i="edit_area_location_"+window.GLOBAL_FD_PLAYLIST_IND;var r=BX(i).firstChild;r.value=(t+"/"+e).replace(/\/\//gi,"/");r.onblur()}function BXSaveImagePath(e,t){var i="edit_area_image_"+window.GLOBAL_FD_PLAYLIST_IND;var r=BX(i).firstChild;r.value=(t+"/"+e).replace(/\/\//gi,"/");r.onblur()}function menuCheckIcons(){var e=BX("bx_playlist_layout"),t=[],i=e.childNodes.length,r,a;for(r=0;r<i;r++){a=e.childNodes[r];if(a.nodeName&&a.nodeName.toLowerCase()=="div"&&a.className=="bx-menu-placement")t.push(a)}var n=t.length;for(r=1;r<=n;r++){tbl=t[r-1].firstChild.firstChild;tbl.rows[0].cells[4].firstChild.style.visibility=r==1?"hidden":"visible";tbl.rows[0].cells[5].firstChild.style.visibility=r==n?"hidden":"visible"}}function itemMoveUp(e){if(GLOBAL_bDisableActions)return;var t=BX("bx_item_row_"+e);var i=t.parentNode;var r=i.id.substring(18);if(r<=1)return;var a=i.previousSibling;var n=a.firstChild;i.appendChild(n);a.appendChild(t);setCurrentRow(t);menuCheckIcons()}function itemMoveDown(e){if(GLOBAL_bDisableActions)return;var t=BX("bx_item_row_"+e);var i=t.parentNode;var r=i.nextSibling;if(null==r)return;var a=r.firstChild;i.appendChild(a);r.appendChild(t);setCurrentRow(t);menuCheckIcons()}function itemDelete(e){if(GLOBAL_bDisableActions)return;var t=BX("bx_item_row_"+e).parentNode;if(t.firstChild==currentRow)currentRow=null;t.parentNode.removeChild(t);menuCheckIcons()}function getAreaHTML(e,t,i){if(null===t)t="";return'<div onmouseout="rowMouseOut(this)" onmouseover="rowMouseOver(this)" class="edit-field view-area" style="width: 220px; padding: 2px; display: block; border: 1px solid white; cursor: text; -moz-box-sizing: border-box; background-position: right center; background-repeat: no-repeat;" id="view_area_'+e+'" onclick="editArea(\''+e+'\')" title="'+i+'">'+(t?t:jsMenuMess.noname)+"</div>"+'<div class="edit-area" id="edit_area_'+e+'" style="display: none;"><input type="text" style="width: 220px;" name="'+e+'" value="'+t+'" onblur="viewArea(\''+e+"')\" /></div>"}var currentEditingRow=null;function editArea(e,t){if(GLOBAL_bDisableActions)return;jsDD.Disable();GLOBAL_bDisableDD=true;jsDD.allowSelection();l=BX("bx_playlist_layout");l.ondrag=l.onselectstart=null;l.style.MozUserSelect="";if(t==null)t=false;var i=BX("edit_area_"+e);var r=BX("view_area_"+e);i.style.display="block";r.style.display="none";i.firstChild.select();i.onkeydown=OnKeyDown;if(!t){i.firstChild.focus();if(jsUtils.IsIE())setTimeout(function(){setCurrentRow(r.parentNode.parentNode.parentNode.parentNode.parentNode)},30);else setCurrentRow(r.parentNode.parentNode.parentNode.parentNode.parentNode)}return i}function viewArea(e){if(GLOBAL_bDisableActions)return;jsDD.Enable();GLOBAL_bDisableDD=false;l=BX("bx_playlist_layout");l.ondrag=l.onselectstart=jsUtils.False;l.style.MozUserSelect="none";var t=BX("edit_area_"+e);var i=BX("view_area_"+e);var r=jsUtils.trim(t.firstChild.value);t.firstChild.value=r;t.onkeydown=null;r=bxhtmlspecialchars(r);i.firstChild.innerHTML=r||jsMess.noname;t.style.display="none";i.style.display="block";currentEditingRow=null;setCurrentRow(i.parentNode.parentNode.parentNode.parentNode.parentNode);return i}function setCurrentRow(e){if(typeof e!="object")e=BX("bx_item_row_"+e);if(null!=currentRow)currentRow.className="bx-edit-menu-item";e.className="bx-edit-menu-item bx-menu-current-row";currentRow=e}function rowMouseOut(e){e.className="edit-field view-area va_playlist";e.style.backgroundColor="transparent"}function rowMouseOver(e,t){if(GLOBAL_bDisableActions||jsDD.bPreStarted)return;e.className="edit-field-active view-area"+(t?" va_playlist_fd_over":" va_playlist");e.style.backgroundColor="white"}function BXDD_DragStart(){if(GLOBAL_bDisableDD)return false;this.BXOldPlacement=this.parentNode;var e=this.id.substring(12);rowMouseOut(viewArea("title_"+e));rowMouseOut(viewArea("location_"+e));rowMouseOut(viewArea("image_"+e));GLOBAL_bDisableActions=true;return true}function BXDD_DragStop(){this.BXOldPlacement=false;setTimeout("GLOBAL_bDisableActions = false",50);return true}function BXDD_DragHover(e,t,i){if(GLOBAL_bDisableDD)return false;i+=oPlaylistDialog.PARTS.CONTENT.scrollTop;var r=jsDD.searchDest(t,i);if(r===false)return false;e=jsDD.arDestinations[r];if(e==this.BXOldPlacement)return false;var a=e.firstChild;this.BXOldPlacement.appendChild(a);e.appendChild(this);this.BXOldPlacement=e;menuCheckIcons();return true}function getRowInnerHTML(e,t,i,r,a){r=parseInt(r);t=t||jsMess.noname;var n=a?", true":"";var s='<td valign="top">'+'<div onmouseout="rowMouseOut(this)" onmouseover="rowMouseOver(this'+n+')" class="edit-field view-area va_playlist" id="view_area_'+e+"_"+i+'" style="width: '+r+'px;" onclick="editArea(\''+e+"_"+i+'\')" title="'+jsMess.clickToEdit+'"><div class="playlist_text">'+t+"</div>";if(a)s+="<span onclick=\"BXOpenFD('"+i+"', '"+a+'\');" class="rowcontrol folder fd_icon" title="'+jsMess.openFDTitle+'"></span>';s+="</div>"+'<div class="edit-area" id="edit_area_'+e+"_"+i+'" style="display:none;"><input type="text" style="width: '+r+'px;" name="'+e+"_"+i+'" value="'+t+'" onblur="viewArea(\''+e+"_"+i+"')\" /></div>"+"</td>";return s}function itemAdd(){var e=BX("bx_item_cnt");var t=parseInt(e.value);e.value=++t;var i=BX("bx_playlist_layout").appendChild(BX.create("DIV",{props:{className:"bx-menu-placement",id:"bx_item_placement_"+t}}));var r='<table class="bx-width100 internal playlist-table"><tbody><tr>'+"	<td>"+'	<input type="hidden" name="ids[]" value="'+t+'" />'+'	<span class="rowcontrol drag" title="'+jsMess.itemDrag+'"></span></td>'+getRowInnerHTML("title",jsMess.noname,t,160)+getRowInnerHTML("location",jsMess.noname,t,150,"VIDEO")+getRowInnerHTML("image",jsMess.noname,t,140,"IMAGE")+'	<td><span onclick="itemMoveUp('+t+')" class="rowcontrol up" style="visibility: '+(t==1?"hidden":"visible")+'" title="'+jsMess.itemUp+'"></span></td>'+'	<td><span onclick="itemMoveDown('+t+')" class="rowcontrol down" style="visibility: hidden" title="'+jsMess.itemDown+'"></span></td>'+'	<td><span onclick="itemDelete('+t+')" class="rowcontrol delete" title="'+jsMess.itemDel+'"></span></td>'+"</tr></tbody></table>";var a=i.appendChild(BX.create("DIV",{props:{className:"bx-edit-menu-item",id:"bx_item_row_"+t},html:r}));jsDD.registerDest(i);a.onbxdragstart=BXDD_DragStart;a.onbxdragstop=BXDD_DragStop;a.onbxdraghover=BXDD_DragHover;jsDD.registerObject(a);setCurrentRow(t);menuCheckIcons();oPlaylistDialog.PARTS.CONTENT.scrollTop=1e4;setTimeout(function(){editArea("title_"+t)},30)}function bxhtmlspecialchars(e){if(typeof e!="string")return e;e=e.replace(/&/g,"&amp;");e=e.replace(/"/g,"&quot;");e=e.replace(/</g,"&lt;");e=e.replace(/>/g,"&gt;");return e}function OnKeyDown(e){if(!e)e=window.event;if(e.ctrlKey||e.altKey)return true;if(e.which==9){var t,i=["title","author","duration","location","image"],r=i.length,a=e.target||e.srcElement,n=parseInt(BX("bx_item_cnt").value),s,l,o=a.name,d=o.indexOf("_"),u=o.substr(0,d).toLowerCase(),l=parseInt(o.substr(d+1));if(!e.shiftKey){for(t=0;t<r;t++){if(i[t]==u){if(t==r-1){if(n==l)return itemAdd();s=i[0];l++;break}else{s=i[t+1];break}}}}else{for(t=0;t<r;t++){if(i[t]==u){if(t==0){if(l<=1)return;l--;s=i[r-1];break}else{s=i[t-1];break}}}}viewArea(o);if(s&&l)setTimeout(function(){editArea(s+"_"+l)},30)}}
//# sourceMappingURL=playlist_edit.map.js